class Solution
{
public:
    vector<vector<int>> findMatrix(vector<int> &nums)
    {
        vector<unordered_set<int>> array;

        for (int num : nums)
        {
            bool arranged = false;
            for (auto &s : array)
            {
                if (!s.count(num))
                {
                    s.insert(num);
                    arranged = true;
                    break;
                }
            }
            if (!arranged)
            {
                array.push_back({num});
            }
        }
        vector<vector<int>> result;
        for (auto &s : array)
        {
            result.push_back({s.begin(), s.end()});
        }
        return result;
    }
};